// 基于准备好的dom，初始化echarts实例
var myChart = echarts.init(document.getElementById('graph'));

flushClass($("#class"));

function selectClass() {
    flushTopicSet($("#topic-set"),{"classid":$("#class").val()});
    $("#topic-set").parent().find(".select2-search-choice").remove();
}


//进行统计
function analysis() {
    var classId=$("#class").val();
    var examId=$("#topic-set").val();

    var json={"classid":classId,"examid[]":examId};

    if (examId.length==0){
        alert("请选择题集");
        return;
    }

    $.get("http://139.199.200.112/dtpr/index.php?exam-teach-users-classexam",json,function (data) {
        data=JSON.parse(data);
        if(data.code!=0){
            alert(data.msg);
        }

        data=data.data;

        console.log(data);

        showdata(data);
        showTable(data);
    })
}